Double writing map table entries in a data storage system to guard against silent corruption

ABSTRACT

A method for writing data in a data storage device includes: writing data to a physical memory location in a non-volatile memory; writing, for a first time, to a location in a volatile memory corresponding to a logical address of the data, a physical address of the physical memory location of the non-volatile memory containing the data; and writing, for a second time, to the location in the volatile memory corresponding to the logical address of the data, the address of the physical memory location of the non-volatile memory containing the data. The physical address of the physical memory location is written with appended error detection code information, and the error detection code information is determined based on the logical address of the data.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation application of U.S. patent application Ser. No. 14/250,212, filed Apr. 10, 2014, which claims the benefit of U.S. provisional application No. 61/943,780 filed Feb. 24, 2014, the disclosures of which are hereby incorporated in their entireties by reference.

BACKGROUND

1. Technical Field

Apparatuses and methods consistent with the present inventive concept relate to data storage systems, and more particularly to double writing of map table entries in a data storage system to avoid silent corruption.

2. Related Art

Any data storage device that uses address indirection relies on a map table to point to a physical location of a latest copy of data at various logical page (L-page) addresses. Thus, the map table serves an important function of maintaining a logical-to-physical correspondence of stored data. Map table entries may be stored in volatile memory such as dynamic random access memory (DRAM). However, map table entries are susceptible to silent corruption.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects and features of the present inventive concept will be more apparent by describing example embodiments with reference to the accompanying drawings, in which:

FIG. 1 is a block diagram illustrating a data storage system according to an example embodiment of the present inventive concept;

FIG. 2 is a diagram illustrating a relationship between a map table and a physical memory;

FIG. 3 is a diagram illustrating an occurrence of silent corruption in a map table;

FIG. 4 is a flowchart illustrating a method for writing data in a storage device according to an example embodiment of the present inventive concept;

FIG. 5 is a diagram illustrating detection of a map table error according to an example embodiment of the present inventive concept;

FIG. 6 is a flow chart illustrating a method for writing data in a storage device after a memory read according to an example embodiment of the present inventive concept and

FIGS. 7A and 7B are diagrams illustrating a relationship between a map table and a physical memory a method for writing data in a storage device after a memory read according to an example embodiment of the present inventive concept.

DETAILED DESCRIPTION

While certain embodiments are described, these embodiments are presented by way of example only, and are not intended to limit the scope of protection. The methods and systems described herein may be embodied in a variety of other forms. Furthermore, various omissions, substitutions, and changes in the form of the example methods and systems described herein may be made without departing from the scope of protection.

Overview

Example embodiments of the present inventive concept provide a method of guarding against silent corruption in a data storage system.

FIG. 1 is a block diagram illustrating a data storage system according to an example embodiment of the present inventive concept. The data storage system 100 may include a host 120 and a data storage device (DSD) such as a solid-state drive (SSD) 110. The SSD 110 may include a control unit 130, a volatile memory 140, for example, but not limited to, a plurality of dynamic random access memory (DRAM) devices or other volatile memory, and a non-volatile memory 150, for example, but not limited to, a non-volatile semiconductor memory (NVSM). The NVSM may be, for example, but not limited to, NAND flash memory devices, NOR flash memory devices, or other NVSM memory devices. The host 120 may issue data read and write commands to the SSD 110. The volatile memory 140 may store a map table. A DSD is generally a device that electronically stores data, so in other embodiments, the DSD may additionally include other types of memory such as rotational magnetic media (e.g., a solid-state hybrid drive (SSHD)).

FIG. 2 is a diagram illustrating a relationship between a map table and a non-volatile physical memory. As illustrated in FIGS. 1 and 2, the map table 210 may be arranged in the volatile memory 140 with memory locations 215 assigned according to a consecutive order (e.g., according to L-page address) and each memory location 215 may contain an entry of a physical address 230 of a physical memory location 225 in non-volatile memory 150 that holds data corresponding to a logical address of the data (L-page) 235. The entries in the memory locations 215 in the map table 210 may be indexed at least in part according to the L-page 235. Referring to FIG. 2, data corresponding to L-page0 may be stored at a physical memory location 225 in the non-volatile memory 150 having a physical address 230 aaa, data corresponding to L-page1 may be stored at a physical memory location 225 in the non-volatile memory 150 having a physical address 230 address bbb, etc. Thus, the map table 210 acts as a set of pointers to the physical memory locations 225 of L-page data in the non-volatile memory 150. Each time L-page data is updated, the new data will be written to a new physical memory location 225 in the non-volatile memory 150. Accordingly, the entries in the memory locations 215 in the map table 210 for the updated L-page data must also be updated to refer to the physical addresses 230 of the new physical memory locations 225 of the data in the non-volatile memory 150.

FIG. 3 is a diagram illustrating an occurrence of silent corruption in a map table. Silent corruption occurs when an update to the map table 210 is written to the wrong map table entry. Referring to FIGS. 1, 2, and 3, an example scenario is described which involves a new write to L-page address 4001. In this example, the entry in the memory location 215 a (i.e., the E-page location) in the map table 210 in the volatile memory 140 corresponding to data for L-page 4001 should have been updated. However, the update was erroneously written to the map table entry in the memory location 215 b corresponding to L-page C001 in the L-page indexed map table 210. This could be caused by a bit flip in the L-page address 4001 to C0001. Hence, the map table entry in the memory location 215 a corresponding to L-page 4001 points to stale data stored at the old physical address in the non-volatile memory 150. This is an undetectable problem because on the next request for L-page 4001 by the host 120, no mechanism exists to determine that the map table entry in the memory location 215 b corresponding to L-page 4001 is stale.

In the map table 210, the entry in the memory location 215 of the physical address 230 for the physical memory location 225 in the non-volatile memory 150 is written with error detection code information 216, for example, but not limited to, cyclic redundancy code (CRC), a hash value, etc., appended to the entry. The error detection code information 216 is determined based at least in part on the L-page address 235 of the data stored at the physical memory location 225 in the non-volatile memory 150. However, a check of the error detection code information 216 a in the map table entry in the memory location 215 a corresponding to the stale data at L-page 4001 will evaluate correctly since the error detection code information 216 a is seeded with the value of L-page 4001. Accordingly, the stale data will be passed to the host 120 undetected. The undetectable the stale data problem is termed “silent corruption” of data. Note that, however, the error detection code information 216 b is effective in triggering an error condition, since error detection code information 216 b is generated based on L-page 4001, but it is written in the entry for L-page C001 which will generate a mismatch.

Double Writing Map Table Entries

Some embodiments of the present inventive concept provide a double writing procedure to write each map table update twice to guard against the undetectable problem of silent corruption where an update to an entry is erroneously written to an incorrect location leaving the intended location pointing to stale data.

As discussed above, when data corresponding to an L-page 235 is updated, the updated data is written to a different physical memory location 225 in non-volatile memory 150 than the original data. The updated data may be data received from a host 120 or may be data read from a physical address 230 of a physical memory location 225 in the non-volatile memory 150, for example during garbage collection. In either case, the new physical address 230 corresponding to the updated data at the L-page 235 should be written to the map table 210. In one embodiment, this is performed at least twice. First, the new physical address 230 is written to the map table entry in the memory location 215 corresponding to the L-page 235 for the data that was updated. Then, the same new physical address 230 is written a second time to the same map table entry in the memory location 215.

By writing twice, the chance of silent corruption is reduced. Given that the probability of writing an update to the wrong location in the map table is 1/P, the probability of writing an update to the wrong location twice becomes 1/P×1/P=1/P².

If both update attempts write to the same correct L-page indexed location of the map table 210 no problem is caused and a subsequent read at that L-page 235 would return the correct data.

FIG. 4 is a flowchart illustrating a method for writing data in a storage device according to an example embodiment of the present inventive concept. Referring to FIGS. 1, 2, and 4, the control unit 130 may be configured to receive data for an L-page 235 c from a host 120 (410), and write the data to a physical memory location 225 c at a physical address yyy 230 c in the non-volatile memory 150 (420).

The control unit 130 may be configured to write for a first time the physical address yyy 230 c of the physical memory location 225 c containing the data corresponding to the L-page 235 c to the entry in the memory location 215 c in the map table 210 corresponding to the L-page 235 c (430). The control unit 130 may be further configured to write for a second time the physical address yyy 230 c to the entry in the memory location 215 c, thereby reducing the chance of silent corruption.

FIG. 5 is a diagram illustrating detection of a map table error according to an example embodiment of the present inventive concept. As illustrated in FIG. 5, if one update attempt writes to the incorrect entry in the memory location 215 b in the map table 210 but the second update attempt writes to the correct entry in the memory location 215 a in the map table 210, the intended entry in the memory location 215 a in the map table 210 will have been correctly updated. The update to the incorrect entry in the memory location 215 b in the map table 210 is detectable by the error detection code 216 b, for example, a CRC mismatch due to the fact that the CRC is L-page value seeded, and an error will be reported when the incorrectly updated entry in the memory location 215 b in the map table 210 is subsequently read.

Thus, example embodiments of the present inventive concept reduce the probability of map table errors resulting from update errors, and mitigate the undetectable silent corruption problem.

FIG. 6 is a flow chart illustrating a method for writing data in a storage device after a memory read according to an example embodiment of the present inventive concept. FIGS. 7A and 7B are diagrams illustrating a relationship between a map table and a physical memory a method for writing data in a storage device after a memory read according to an example embodiment of the present inventive concept.

Referring to FIGS. 1, 6, 7A, and 7B, the control unit 130 may be configured to read data corresponding to an L-page 235 c from a first physical location 225 c at a first physical address yyy 230 c in the non-volatile memory 150 (610), and to subsequently write the data corresponding to the L-page 235 c to a second physical memory location 225 d at a second physical address www 230 d in the non-volatile memory 150 (620). The control unit 130 may be further configured to modify the data that was read before subsequently writing the data to the second physical memory location 225 d.

The control unit 130 may be configured to write for a first time the second physical address www 230 d of the second physical memory location 225 d containing the subsequently written data corresponding to the L-page 235 c to the entry in the memory location 215 c (630). The control unit 130 may be further configured to write for a second time the second physical address www 230 d to the entry in the memory location 215 c (640), thereby reducing the chance of silent corruption.

While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the protection. The methods and systems described herein may be embodied in a variety of other forms. Various omissions, substitutions, and/or changes in the form of the example methods and systems described herein may be made without departing from the spirit of the protection.

The example embodiments disclosed herein can be applied to solid state drives, hybrid hard drives, and the like. Solid-state memory may comprise a wide variety of technologies, such as flash integrated circuits, Phase Change Memory (PC-RAM or PRAM), Programmable Metallization Cell RAM (PMC-RAM or PMCm), Ovonic Unified Memory (OUM), Resistance RAM (RRAM), NAND memory, NOR memory, EEPROM, Ferroelectric Memory (FeRAM), MRAM, or other discrete NVM (non-volatile solid-state memory) chips. In addition, other forms of storage, for example, but not limited to, DRAM or SRAM, battery backed-up volatile DRAM or SRAM devices, EPROM, EEPROM memory, etc., may additionally or alternatively be used. As another example, various components illustrated in the figures may be implemented as software and/or firmware on a processor, ASIC/FPGA, or dedicated hardware. Also, the features and attributes of the specific example embodiments disclosed above may be combined in different ways to form additional embodiments, all of which fall within the scope of the present disclosure.

Although the present disclosure provides certain example embodiments and applications, other embodiments that are apparent to those of ordinary skill in the art, including embodiments which do not provide all of the features and advantages set forth herein, are also within the scope of this disclosure. Accordingly, the scope of the present disclosure is intended to be defined only by reference to the appended claims. 

What is claimed is:
 1. A method for writing data in a data storage device using a control unit, the method comprising: writing, by the control unit, data to a physical memory location in a non-volatile memory; sending, by the control unit, a first update request corresponding to the data to write a physical address of the physical memory location to a location in a table corresponding to a logical address of the data; and sending, by the control unit, a second update request corresponding to the data to write the physical address of the physical memory location to the location in the table corresponding to the logical address of the data.
 2. The method of claim 1, wherein sending the second update request reduces a probability of writing the physical address of the physical memory location to a wrong location in the table.
 3. The method of claim 1, wherein the table resides in a volatile memory.
 4. The method of claim 1, wherein the table is arranged with memory locations assigned according to a consecutive order.
 5. The method of claim 1, wherein the first update request and the second update request cause error detection code information to be appended to the physical address written to the table.
 6. The method of claim 5, wherein the error detection code information is determined based on the logical address of the data.
 7. The method of claim 5, further comprising detecting incorrect information at a particular location in the table by detecting a mismatch between the error detection code information stored at the particular location and predetermined error detection code information associated with the particular location at the table.
 8. The method of claim 1, further comprising reading the data from another physical address of the non-volatile memory prior to writing the data to the physical memory location.
 9. The method of claim 8, further comprising modifying the data read from the other physical address of the non-volatile memory prior to writing the data to the physical memory location.
 10. The method of claim 1, wherein the non-volatile memory comprises NAND flash memory devices.
 11. The method of claim 3, wherein the volatile memory is dynamic random access memory (DRAM).
 12. A data storage device, comprising: a non-volatile memory; a control unit configured to: write data to a physical memory location in the non-volatile memory; send a first update request corresponding to the data to write a physical address of the physical memory location to a location in a table corresponding to a logical address of the data; and send a second update request corresponding to the data to write the physical address of the physical memory location to the location in the table corresponding to the logical address of the data.
 13. The data storage device of claim 12, wherein the second update request reduces a probability of writing the physical address of the physical memory location to a wrong location in the table.
 14. The data storage device of claim 12, further comprising a volatile memory configured to maintain the table.
 15. The data storage device of claim 12, wherein the first update request and the second update request cause error detection code information to be appended to the physical address written to the table.
 16. The data storage device of claim 15, wherein the error detection code information is determined based on the logical address of the data.
 17. The data storage device of claim 15, wherein the control unit is configured to detect incorrect information stored at a particular location in the table by detecting a mismatch between the error detection code information stored at the particular location and predetermined error detection code information associated with the particular location at the table.
 18. The data storage device of claim 12, wherein the control unit is configured to read the data from another physical address of the non-volatile memory prior to writing the data to the physical memory location.
 19. The data storage device of claim 18, wherein the control unit is configured to modify the data read from the other physical address of the non-volatile memory prior to writing the data to the physical memory location.
 20. The data storage device of claim 12, wherein the non-volatile memory comprises NAND flash memory devices. 